package page;

import java.sql.SQLException;
import dao.*;
import entity4wms.Entry;

public class MainPage {
    public static Integer userID = null;
    public static void main(String[] args) throws SQLException, ClassNotFoundException {
        userID =  printPage.checkLogin();
        mainMenu();
    }

    public static void mainMenu() throws SQLException, ClassNotFoundException{
        String[] SubMenuStr = {"","add", "edit", "delete","query"};
        //String[] menuDeliver = {"","add", "edit", "delete","query"};
        String[] menuStrings = {"", "Good information", "Account","Delivery",
                            "EntryNote","Inventory"};
        
        String choice = printPage.mainMenu(menuStrings);
        do{
            switch (Integer.parseInt(choice)){ 
            case 0 -> SubMenu.exitMenu();
            case 1 -> SubMenu.menuGood(SubMenuStr);
            case 2 -> SubMenu.menuAccount(SubMenuStr);
            case 3 -> SubMenu.menuDelivered(SubMenuStr,userID);
            case 4 -> SubMenu.menuEntry(SubMenuStr, userID);
            case 5 -> SubMenu.menuInvertory(SubMenuStr);
            default -> System.out.println("输入有误");   
            }
         
        }while (true);
    
    }
}